Posted by FrontRunner from ts001d26.kal-mi.concentric.net (206.173.106.38) on May 24, 1999 at 14:40:52:
In Reply to: Could we see source for more detail look of you problem? (nt) posted by Jari Jokivuori on May 24, 1999 at 02:22:42:
I found the problem, I accidentally had glEnable(GL_TEXTURE_GEN_S) and glEnable(GL_TEXTURE_GEN_T)
so it caused multiple copies of the texture. (OOPS!) :)
Now I have another problem, it seems that the program I am using to convert the 3d model to
a format that openGL likes, it is outputting coordinates for textures that are like :
glNormal3f(-0.689262f, 0.0291188f, -0.723927f);
glTexCoord2f(1.0f, 0.0f);
glVertex3f(-0.990544f, -0.368661f, -2.00558f);
glNormal3f(-0.689262f, 0.0291188f, -0.723927f);
glTexCoord2f(1.0f, 1.0f);
glVertex3f(-0.260618f, 1.38556f, -2.62999f);
glNormal3f(-0.689262f, 0.0291188f, -0.723927f);
glTexCoord2f(1.0f, 0.0f);
glVertex3f(0.991097f, 0.426811f, -3.86033f);
glNormal3f(-0.689262f, 0.0291188f, -0.723927f);
glTexCoord2f(1.0f, 0.0f);
glVertex3f(0.261171f, -1.32741f, -3.23592f);
and so on...
It seems that the glTexCoord2f() says that the vaules should fall in the range of 0 to 1, for 'normal'
mapping, and higher values for multiple copies of the same texture.
But with the values as they are above, I only see part of the texture that is on the
polygon. (it looks like 1/3 or maybe 1/4 of the original bitmap.
For the texture, I set up like:
glBindTexture(GL_TEXTURE_2D, tex1);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, 3, bmi.biWidth, bmi.biHeight, 0,
GL_RGB, GL_UNSIGNED_BYTE, rgb);
So, can anyone take a guess as to why only part of the texture is mapped on to the
above polygon? Does it have to do with the fact the the texture coordinates are lower
than 1? (this will be my next test, changing the vaules to 0 and 1 and see if it makes a
difference.)